{% extends 'base.html' %}
{% block main %}

    <div class="container">
    <h1>服务器列表</h1>
    <div>
    <a style="margin: 10px 0;" class="btn btn-primary" href="{{ url_for('add') }}">添加</a>
    </div>
    <table class="table table-bordered">
    <thead>
    <tr>
        <th>ID</th>
        <th>主机名</th>
        <th>IP地扯</th>
        <th>设备组</th>
        <th>备注</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {% for row in hostlist %}
    <tr>
        <th>{{ row.id }}</th>
        <th>{{ row.hostname }}</th>
        <th>{{ row.ipaddr }}</th>
        <th>{{ row.Groups }}</th>
        <th>{{ row.Desc }}</th>
        <th><a>编辑</a> <a href="/delhost/{{ row['id'] }}">删除</a></th>
    </tr>
    {% endfor %}
    </tbody>
    </table>
    </div>
{% endblock %}